package main.modelTests;

import main.model.persistence.ReadableObject;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Atributo extends ReadableObject {

	private String type;
	
	private String nombre;
	
	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public String getNombre() {
		return nombre;
	}

	@Override
	public void loadObject(Node input) {
		
		Element e = (Element)input;
		setType(e.getAttribute("type"));
		
		NodeList childNodes = input.getChildNodes();
		for (int temp = 0; temp < childNodes.getLength(); temp++) {
			Node nNode = childNodes.item(temp);
			setNombre(nNode.getNodeValue());
		}
		
	}

}
